package com.cc.teambuiding.service.Impl;

import com.cc.teambuiding.entity.User;
import com.cc.teambuiding.mapper.UserMapper;
import com.cc.teambuiding.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> listUsers() {
        return userMapper.selectList(null);
    }

    @Override
    public boolean addUser(User user) {
        return userMapper.insert(user) > 0;
    }

    @Override
    public List<User> getUsersBySquadId(Long squadId) {
        return userMapper.selectBySquadId(squadId);
    }
}
